<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆</title>
</head>
<body>

    <div style="text-align: left;margin-left:500px;margin-top: 150px;">

        <form action="../user" method="post">
            <input type="hidden" name="method" value="userLogin" />
            <table>
                <tr>
                    <td colspan="2" style="text-align: center">
                        <h2>登陆</h2>
                    </td>
                </tr>
                <tr>
                    <td>
                        用户名：
                    </td>
                    <td>
                        <input type="text" name="userName">
                    </td>
                </tr>
                <tr>
                    <td>
                        密码：
                    </td>
                    <td>
                        <input type="text" name="userPassword">
                    </td>
                </tr>
                <tr>
                    <td>
                        验证码：
                    </td>
                    <td>
                        <input type="text" name="validate">
                    </td>
                    <td >
                        &nbsp;&nbsp;<img id="img1" src="../validatecode" alt="验证码" height="30px" onclick="changeCode(this)">
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center">
                        <input type="submit" value="登陆">&nbsp;
                        <a href="registere.jsp">注册</a>
                    </td>

                </tr>

            </table>
        </form>

    </div>


</body>
<script>
    /**
     * 更换验证码
     * @param obj
     */
    function changeCode(obj) {
        obj.src = "../validatecode?time=" + new Date().getTime();
    }

</script>


</html>